<?PHP
	if (!isset($_SESSION)) session_start();
	header("Content-Type: text/html; charset=utf-8", true);
?>

<!DOCTYPE html>
<html>
	<head>
		<title>CKJ Store</title>
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery.orbit.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/home.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" href="css/style.css">
		<link rel="stylesheet" href="css/orbit.css">
	</head>
	<body>
		<div class="container">
			<div class="head">
				<a id="logo" href="index.php">CKJ Store</a>
				
				<?php 
					include 'head_login.php';
				?>
			</div>

			<!-- fim do header-->

			<?php include 'head_search.php'; 
			
			if(isset($_GET['user_form_success'])){
			    if($_GET['user_form_success'] == 'true'){
			         echo '<span class="flash-message">Cliente cadastrado com Sucesso</span>';
			    }
			}   

			if(isset($_GET['product_form_success'])){
			    if($_GET['product_form_success'] == 'true'){
			         echo '<div><span class="flash-message">Produto cadastrado com Sucesso</span></div>';
			    }
			} 

			if(isset($_GET['user_edit_success'])){
			    if($_GET['user_edit_success'] == 'true'){
			         echo '<div><span class="flash-message">Usuário atualizado com Sucesso</span></div>';
			    }
			} 

			if (!isset($_SESSION)) session_start();
			
			if(isset($_SESSION['UsuarioID']))
			{
			if($_SESSION['UsuarioNivel'] == 3)
				echo "<a href=\"cadastroProdutoAdm.php\" id=\"add-product\">+ Adicionar produto</a>";
			else if($_SESSION['UsuarioNivel'] == 2)
				echo "<a href=\"cadastroProdutoCliente.php\" id=\"add-product\">+ Adicionar produto</a>";
			}
			?>

			<div class="slideshow">
				<div id="featured">
					<img src="images/slideShow1.png" />
					<img src="images/slideShow2.png" data-caption="#htmlCaption" />
					<img src="images/slideShow3.png"  />
				</div>
			</div>

			<div><span class="highlights">Últimas Vendas</span></div>

			<div class="wall">
				<?php include "acaoProdutosPaginaInicial.php" ?>
			</div>
		</div>
	</body>
</html>
